<template>
  <div>
    <h1>个人信息</h1>
    <table width="1500px" >
      <tr >
        <td>用户名</td>
        <td>邮箱号</td>
        <td>图片</td>
        <td>状态</td>
        <td>会员</td>
        <td>积分</td>
        <td>邀请码</td>
      </tr>
      <tr v-for="i in userlist" :key="i.id">
        <td>{{i.username}}</td>
        <td>{{i.email}}</td>
        <td><img src="" alt=""></td>
        <td>{{i.is_active |jihuo}}</td>
        <td>{{i.level |huiyuan}}</td>
        <td>{{i.ingtegral}}</td>
        <td>{{i.invitation_code}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
  export default {
    name: "usershow",
    data() {
      return {
        email: sessionStorage.getItem('email'),
        uid: sessionStorage.getItem('uid'),
        userlist: {}
      }
    },
    created() {
      this.axios.get('/usershow/?uid=' + this.uid).then(res => {
        console.log(res.data)
        this.userlist = res.data
      })
    },
    filters: {
      jihuo(value) {
        if (value === 1) {
          return '未激活'
        } else if (value === 2) {
          return '激活'
        }
      },
      huiyuan(value) {
        if (value === 1) {
          return '普通会员'
        } else if (value === 2) {
          return 'vip会员'
        }

      }
    }
  }
</script>

<style scoped>

</style>
